package com.codinghero.zqlb.spider.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.codinghero.zqlb.spider.bo.MatchBo;

public class MatchSpiderServlet extends HttpServlet {

	private static final long serialVersionUID = 342736141341749401L;

	private MatchBo matchBo = new MatchBo();
	
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
    	int[] affectedNums = matchBo.spide();
    	
    	resp.setCharacterEncoding("UTF-8");
    	PrintWriter out = resp.getWriter();
    	out.println("更新了" + affectedNums[0] + "个比赛的时间");
		out.println("更新了" + affectedNums[1] + "个比赛的转播频道");
		out.println("删除了" + affectedNums[2] + "个重复的比赛");
		out.println("删除了" + affectedNums[3] + "个重复的比赛");
		out.println("新增了" + affectedNums[4] + "个比赛");
    }
}
